package com.lind.kickoff.logic;

import java.io.Serializable;

public class MovePoint implements Serializable {

	private static final long serialVersionUID = 1502005422557131521L;

	public int[] dir = new int[9];
	public IPoint coord;

	public MovePoint(IPoint c, int d) {
		coord = c;
		dir[d] = 1;
	}

	public MovePoint(IPoint c, int[] d) {
		coord = c;
		dir = d;
	}

	public String toString() {
		String str = (coord != null ? coord.toString() : "") + "-";
		for (int i = 0; i < 9; i++)
			str += dir[i];
		return str;
	}

	public int getDirSum() {
		return dir[0] + dir[1] + dir[2] + dir[3] + dir[4] + dir[5] + dir[6]
				+ dir[7];
	}

	public MovePoint deepCopy() {
		int[] tmp = new int[9];
		System.arraycopy(dir, 0, tmp, 0, 9);
		MovePoint mp = new MovePoint(coord.deepCopy(), tmp);
		return mp;
	}

}